import torch


def get_lambda(WDM_channel, channel_spacing_Hz):
    if WDM_channel % 2 == 0:
        df_matrix = channel_spacing_Hz * torch.linspace(-(WDM_channel / 2 - 1), WDM_channel / 2, WDM_channel)
    else:
        df_matrix = channel_spacing_Hz * torch.linspace(-(WDM_channel - 1) / 2, (WDM_channel - 1) / 2, WDM_channel)
    return df_matrix
